package com.diver.flinkdemo.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.diver.flinkdemo.constant.CommonConstant;
import com.diver.flinkdemo.entity.xxt.Depart;
import com.diver.flinkdemo.entity.xxt.PersonBasicInfo;
import com.diver.flinkdemo.entity.xxt.PersonDepart;
import com.diver.flinkdemo.entity.xxt.TerminalUnit;
import com.diver.flinkdemo.enums.DataEnum;
import com.diver.flinkdemo.mapper.mysqlMapper.MoreSettingMapper;
import com.diver.flinkdemo.mapper.mysqlMapper.PersonBasicInfoMapper;
import com.diver.flinkdemo.mapper.mysqlMapper.PersonDepartMapper;
import com.diver.flinkdemo.service.ILocationInfoService;
import com.diver.flinkdemo.service.IPersonBasicInfoService;
import com.diver.flinkdemo.service.IPersonDepartService;
import com.diver.flinkdemo.utils.DateUtil;
import com.diver.flinkdemo.utils.DynamicDataSourceUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.flink.runtime.topology.Result;
import org.apache.ibatis.session.SqlSession;
import org.jvnet.hk2.annotations.Service;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.Serializable;
import java.security.PrivateKey;
import java.util.*;
import java.util.stream.Collectors;

/**
 * @Description: 人员基础信息
 * @Author: jeecg-boot
 * @Date: 2022-05-10
 * @Version: V1.0
 */
@Slf4j
public class PersonBasicInfoServiceImpl extends ServiceImpl<PersonBasicInfoMapper, PersonBasicInfo> implements IPersonBasicInfoService {

    private PersonBasicInfoMapper mapper;
    private SqlSession session;
    /**
     * 获取人员信息 人员id
     *
     * @param personId
     * @return
     */
    @Override
    public PersonBasicInfo getPersonBasicInfoById(String personId) {

        session = DynamicDataSourceUtil.mysqlSessionFactory.openSession(true);
        mapper = session.getMapper(PersonBasicInfoMapper.class);
        return baseMapper.getInfoById(personId);
    }
}
